window.onload = function () {
    var o = document.querySelector('.O');
    var mymenu = document.querySelector('.menu');
    o.addEventListener('click', function () {
        o.classList.toggle('X');
        mymenu.classList.toggle('menu-open')
    });
    var mySwiper = new Swiper('#swiper1', {
        loop: true, // 循环模式选项
        effect: 'fade',

        // 如果需要分页器
        pagination: {
            el: '.swiper-pagination',
        },
        autoplay: {
            delay: 2000,
            /* stopOnLastSlide: false,
            disableOnInteraction: true, */
        },

        // 如果需要前进后退按钮
        navigation: {
            nextEl: '.swiper-button-next',
            prevEl: '.swiper-button-prev',
        },

        // 如果需要滚动条
        scrollbar: {
            el: '.swiper-scrollbar #swiper1'
        },
    });
    var mySwiper2 = new Swiper('#swiper2', {
        // direction: 'horizontal', // 垂直切换选项
        loop: true, // 循环模式选项
        effect: 'coverflow',

        // 如果需要分页器
       /*  pagination: {
            el: '.swiper-pagination',
        }, */
        autoplay: {
            delay: 2000,
            /* stopOnLastSlide: false,
            disableOnInteraction: true, */
        },

        // 如果需要前进后退按钮
        navigation: {
            nextEl: '.swiper-button-next',
            prevEl: '.swiper-button-prev',
        },

        // 如果需要滚动条
        /* scrollbar: {
            el: '.swiper-scrollbar',
        }, */
    })

} 